﻿package {
	import flash.display.Sprite;
	
	/**
	 * This example is based on the "counter example" from Qt.
	 * @link http://doc.trolltech.com/4.6/signalsandslots.html#a-small-example
	 */
	public class Main extends Sprite {
		
		public function Main():void {
			var counter1:Counter = new Counter();
			var counter2:Counter = new Counter();
			trace(counter1.getValue(), counter2.getValue()); //0 0
			
			counter1.onChange.add(counter2.setValue);
			
			
			counter1.setValue(10);
			trace(counter1.getValue(), counter2.getValue()); //10 10
			
			counter2.setValue(20);
			trace(counter1.getValue(), counter2.getValue()); //10 20
		}
	}
}